package com.irdstudio.efp.esb.api.service.common.repository;

import com.irdstudio.efp.console.common.ConsoleConstant;
import com.irdstudio.efp.ctr.service.facade.CtrLoanContService;
import com.irdstudio.efp.ctr.service.vo.CtrLoanContVO;
import com.irdstudio.efp.limit.service.vo.LmtPrdContVO;
import com.irdstudio.efp.limit.service.vo.LmtPrdContVOBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2020/4/23
 * 功能描述:
 * 修改日期:2020/4/23
 * 修改描述:
 */
@Service("ctrLoanRepository")
public class CtrLoanRepository {
    @Autowired
    @Qualifier("ctrLoanContService")
    private CtrLoanContService ctrLoanContService;

    public CtrLoanContVO getLmtPrdContBySeq(String lmtApplySeq) {
        CtrLoanContVO ctrLoanContVO = new CtrLoanContVO();
        ctrLoanContVO.setContNo(lmtApplySeq);
        return Optional.ofNullable(ctrLoanContService.queryByPk(ctrLoanContVO)).orElseGet(CtrLoanContVO::new);
    }

}
